package com.mrli.cat.weather.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by MrLi on 2015/7/4.
 */
public class City implements Parcelable {
    private String mCityName;   //城市名
    private Double lat;         //纬度
    private Double lon;         //经度

    public City(String mCityName, Double lat, Double lon) {
        this.mCityName = mCityName;
        this.lat = lat;
        this.lon = lon;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Double getLon() {
        return lon;
    }

    public void setLon(Double lon) {
        this.lon = lon;
    }

    public String getmCityName() {
        return mCityName;
    }

    public void setmCityName(String mCityName) {
        this.mCityName = mCityName;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(mCityName);
        dest.writeDouble(lat);
        dest.writeDouble(lon);
    }

    public static final Parcelable.Creator<City> CREATOR = new Parcelable.ClassLoaderCreator<City>() {

        @Override
        public City createFromParcel(Parcel source) {
            return null;
        }

        @Override
        public City[] newArray(int size) {
            return new City[size];
        }

        @Override
        public City createFromParcel(Parcel source, ClassLoader loader) {
            return new City(source.readString(),
                    source.readDouble(),
                    source.readDouble());
        }
    };

}
